<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .red{
            background-color: red;
            height: 100px;
            width: 100px;
        }
        .green{
            background-color: green;
            height: 100px;
            width: 100px;
        }
    </style>
</head>
<a>
test thymeleaf！
<br />
取值：<input value="hello" th:value="${hello}"/><input value="hello" th:value="${session.s}"/><input value="hello" th:value="${#request.getAttribute('r')}"/>
<br />
循环：<input th:value="${hello}" th:each="str:${list}"/>
<br />
<div th:each="str:${list}">
    <input th:value="${hello}"/>
</div>

<br />
判断<input th:value="我存在" th:if="${1==1}"/>
<br />
表达式
<div th:class="(${1==0}?'red':'green')"></div>

<br />
与js交互
<a th:href="'javascript:a(\''+${num}+'\');'"/>点我</a>
<a href="javascript:a('奥力给');"/>再点我</a>
<br />
页面引入
<div th:include="testInner::a"></div>

<script language="JavaScript">
    function a(num){
        alert(num);
    }
</script>
</body>
</html>